package exp03;

import java.util.LinkedList;
import java.util.Queue;
//线性队列满足FIFO
public class QueueDemo2 {
    public static void main(String[] args) {
        Queue<Integer> Q = new LinkedList<>();
        for (int i = 0; i < 10; i++) {
            Q.offer(i % 5);//i push
        }
        while (!Q.isEmpty()) {
            System.out.println(Q.peek());//队头元素front
            Q.poll();//pop 出队
        }
    }
}
